<script>
	export default {
		globalData: {
			myAdd: uni.getStorageSync('myAdd') || '', //所在地区信息
			addList: uni.getStorageSync('addList') || [], //地址列表缓存
			// location: uni.getStorageSync('location') || '', //当前定位信息
		},
		onLaunch(opt) {
			this.$getConfig()
			this.$store.dispatch('chat/start')
			// #ifdef MP
			const updateManager = uni.getUpdateManager();
			updateManager.onCheckForUpdate(function(res) {
				// 请求完新版本信息的回调
				console.log('update', res.hasUpdate);
			});
			updateManager.onUpdateReady(function(res) {
				uni.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					success(res) {
						if (res.confirm) {
							// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
							updateManager.applyUpdate();
						}
					}
				});
			});
			updateManager.onUpdateFailed(function(res) {
				// 新的版本下载失败
			});
			// #endif
		},
		onShow() {
			// 启动或重启即时通讯
			this.$store.dispatch('chat/start');
		},
		onHide() {
			// 断开即时通讯
			this.$store.dispatch('chat/close');
		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	@import "static/css/public.scss";

	page {
		background-color: #f2f3f7;
		font-size: 28rpx;
		color: #232323;
		font-family: PingFangSC;
		word-break: break-all; //文本换行
	}

	.color-zs {
		color: $zs;
	}

	.bg-zs {
		background-color: $zs;
	}

	.color-fs {
		color: $fs;
	}

	.bg-fs {
		background-color: $fs;
	}

	.border-zs {
		border: $zs 1px solid;
	}

	.bg-zs-007 {
		background-color: transparentize($color: $zs, $amount: .93);
	}

	.sel_zs {
		background-color: transparentize($color: $zs, $amount: .92);
		color: $zs;
		border: $zs 1rpx solid;
	}

	.color-454 {
		color: #454545
	}

	.color-1C1C {
		color: #1C1C1C
	}

	.shadow {
		box-shadow: -4px 0px 20px 4px rgba(218, 218, 218, 0.22)
	}

	.zs-box {
		background: transparentize($color: $zs, $amount: .92);
		border: 1rpx solid $zs;
	}

	.tit-ac {
		position: relative;
	}

	.tit-ac::before {
		content: "";
		position: absolute;
		width: 6rpx;
		height: 20rpx;
		left: -24rpx;
		top: 50%;
		transform: translateY(-50%);
		background: $zs;
	}
</style>